{template 'common/header'}
<ul class="nav nav-tabs">
	<li class="active"><a>往期商品列表</a></li>
	<li><a href="{php echo $this->createWebUrl('goods', array('op'=>'display'));}">商品列表</a></li>
	<li><a href="{php echo $this->createWebUrl('goods', array('op'=>'edit'));}">添加商品</a></li>
</ul>
	<div class="panel panel-default">
		<div class="panel-heading">往期商品列表<a href="javascript:;" onclick="history.go(-1);" style="margin-left: 80%;" class="btn btn-success btn-sm">返回</a></div>
		<div class="panel-body">
			<div class="table-responsive panel-body">
				<table class="table table-hover table-bordered" style="min-width: 300px;">
					<thead class="navbar-inner">
						<tr>
							<th style="width:30px;text-align: center;">ID</th>
							<th style="width:100px;text-align: center;">商品名称</th>
							{if WELIAM_INDIANA_VERSION == 'special'}
							<th style="width:60px;text-align: center;">所属商家</th>
							{/if}
							<th style="width:50px;text-align: center;">商品图片</th>
							<th style="width:40px;text-align: center;">单价/元</th>
							<th style="width:60px;text-align: center;">期数</th>
							<th style="width:60px;text-align: center;">已参与人数</th>
							<th style="width:100px;text-align: center;">揭晓状态</th>
							<th style="width:160px;text-align: center;">管理</th>
						</tr>
					</thead>
					<tbody style="text-align: center;">
						{loop $periods  $period}
						<tr>
							<td>{$period['id']}</td>
							<td>第(<font color="red">{$period['periods']}</font>)期 -{$goods['title']}</td>
							{if WELIAM_INDIANA_VERSION == 'special'}
							<td>{$merchant['name']}</td>
							{/if}
							<td><image src="{php echo tomedia($goods['picarr']);}" style="max-width: 48px; max-height: 48px; border: 1px dotted gray"></td>
							<td>{$goods['price']}</td>
							<td><font color="red">{$period['periods']}</font>/{$goods['maxperiods']}</td>
							<td><font color="red">{php echo $period['zong_codes']-$period['shengyu_codes']}</font>/{$period['zong_codes']}</td>
							<td>{if $period['status']==1}未揭晓{else}<font color="red">已揭晓</font>{/if}</td>
							<td>
								<a href="{php echo $this->createWebUrl('srecords', array('period_number'=>$period['period_number'],'gid'=>$period['goodsid']));}" class="btn btn-success btn-sm" data-original-title="" title="">购买详细</a>
								<a href="{php echo $this->createWebUrl('shujuhuifu', array('period_number'=>$period['period_number'],'op'=>'cwsp'));}" class="btn btn-success btn-sm" data-original-title="" title="">{if $period['status']==-1}已退款{else}退款{/if}</a>
							</a>
							</td>
						</tr>
						{/loop}
						{if empty($periods)}
						<tr>
							<td colspan="8">
								没有往期商品
							</td>
						</tr>
						{/if}
					</tbody>
				</table>
				{$pager}
			</div>
		</div>
	</div>
</div>

{template 'common/footer'}